<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="未开票预警" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm"
                            ng-disabled="!btnPermission.unInvoiceWarningEdit"
                            title="{{!btnPermission.unInvoiceWarningEdit?'无权限执行此操作':''}}"
                            ng-click="updateRemarkBatch()">批量维护备注</button>
                    <button class="btn btn-operate m-r-sm"
                            ng-disabled="!btnPermission.unInvoiceWarningToDbd"
                            title="{{!btnPermission.unInvoiceWarningToDbd?'无权限执行此操作':''}}"
                            ng-click="addUnInvoiceWarning()">生成督办单</button>
                    <button class="btn btn-operate m-r-sm" ng-click="handleSyncSaleReport()">手动同步</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color"   ng-if="btnPermission.unInvoiceWarningExport">
                            <div title="导出" yb-download download-url="exportParam.allUrl" download-param="condition"
                                is-ajax="true">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索
                    </button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="销售单号"
                            ng-model="condition.saleNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                    reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span>销售单号</span>：</label>
                            <input ng-model="condition.saleNo" class="form-control" placeholder="多个逗号分割">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>采购单号</span>：</label>
                            <input ng-model="condition.purchaseNo" class="form-control" placeholder="采购单号">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>发货通知单号</span>：</label>
                            <input ng-model="condition.deliveryNo" class="form-control" placeholder="发货通知单号">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>发运交接单号</span>：</label>
                            <input ng-model="condition.deliveryBillNo" class="form-control" placeholder="发运交接单号">
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label"><span>单据状态</span>：</label>
                            <select class="form-control" ng-model="condition.status">
                                <option value="">请选择</option>
                                <option value="0">未完成</option>
                                <option value="1">已完成</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>已生成督办单</span>：</label>
                            <select class="form-control" ng-model="condition.dbdFlag">
                                <option value="">请选择</option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="false"
                has-check-col="true"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allChecked"
                                            yb-click="selectAll(dataList)"></div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.scrollLeft"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, dataList)"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <div>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                    title="{{!btnPermission.unInvoiceWarningEdit?'无权限执行此操作':''}}"
                                                ng-disabled="item.status==1||!btnPermission.unInvoiceWarningEdit" ng-click="updateRemark(item)">编辑
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div ng-switch="itemCol.type">
                                            <div ng-switch-when="click">
                                                <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                                    {{item[itemCol.dataField]}}
                                                </a>
                                            </div>
                                            <div ng-switch-default class="spill-dots">
                                                <span>{{item[itemCol.dataField]}}</span>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="未开票-代理商" active="activeFlag[1]" ng-click="changeTab(1)">
            <div ng-if="activeFlag[1]">
                <form name="checkForm" class="m-t-lg form-horizontal form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>预警时间起始</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control date-picker" name="adjustDateStart" required
                                ng-model="echartsCondition1.queryStartDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                                modal-size="small" is-open="adjustDateStartShow" close-text="关闭" readonly
                                ng-change="checkDate(echartsCondition1, 'queryStartDate', 'queryEndDate')"
                                ng-click="adjustDateEndShow=false;adjustDateStartShow=!adjustDateStartShow">

                            <div class="msg-block" ng-show="checkForm.adjustDateStart.$invalid && submitted">
                                <div class="error-msg"
                                    ng-if="checkForm.adjustDateStart.$error.required && !checkForm.adjustDateStart.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>预警时间截止</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control date-picker" name="adjustDateEnd" required
                                ng-model="echartsCondition1.queryEndDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                                modal-size="small" is-open="adjustDateEndShow" close-text="关闭" readonly
                                ng-change="checkDate(echartsCondition1, 'queryStartDate', 'queryEndDate')"
                                ng-click="adjustDateStartShow=false;adjustDateEndShow=!adjustDateEndShow">

                            <div class="msg-block" ng-show="checkForm.adjustDateEnd.$invalid && submitted">
                                <div class="error-msg"
                                    ng-if="checkForm.adjustDateEnd.$error.required && !checkForm.adjustDateEnd.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>代理商</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control light-bg" ng-model="echartsCondition1.dealerNameLike" ng-click="selectDealer(echartsCondition1)" readonly placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <span class="btn btn-primary searchBtn" ng-click="echartsSearch1(checkForm.$valid)">搜索</span>
                    </div>
                </form>
                <div yb-bar-chart class="chart-wrap m-t-lg" chart-axis="echartsOption1" xaxis-title="代理商" style="height:400px;"></div>
            </div>
        </div>
        <div tab heading="未开票-预警时间" active="activeFlag[2]" ng-click="changeTab(2)">
            <div ng-if="activeFlag[2]">
                <form name="checkForm" class="m-t-lg form-horizontal form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>预警时间起始</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control date-picker" name="adjustDateStart" required
                                ng-model="echartsCondition2.queryStartDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                                modal-size="small" is-open="adjustDateStartShow" close-text="关闭" readonly
                                ng-change="checkDate(echartsCondition2, 'queryStartDate', 'queryEndDate')"
                                ng-click="adjustDateEndShow=false;adjustDateStartShow=!adjustDateStartShow">

                            <div class="msg-block" ng-show="checkForm.adjustDateStart.$invalid && submitted">
                                <div class="error-msg"
                                    ng-if="checkForm.adjustDateStart.$error.required && !checkForm.adjustDateStart.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>预警时间截止</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control date-picker" name="adjustDateEnd" required
                                ng-model="echartsCondition2.queryEndDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                                modal-size="small" is-open="adjustDateEndShow" close-text="关闭" readonly
                                ng-change="checkDate(echartsCondition2, 'queryStartDate', 'queryEndDate')"
                                ng-click="adjustDateStartShow=false;adjustDateEndShow=!adjustDateEndShow">

                            <div class="msg-block" ng-show="checkForm.adjustDateEnd.$invalid && submitted">
                                <div class="error-msg"
                                    ng-if="checkForm.adjustDateEnd.$error.required && !checkForm.adjustDateEnd.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>代理商</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control light-bg" ng-model="echartsCondition2.dealerNameLike" ng-click="selectDealer(echartsCondition2)" readonly placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <span class="btn btn-primary searchBtn" ng-click="echartsSearch2(checkForm.$valid)">搜索</span>
                    </div>
                </form>
                <div yb-bar-chart class="chart-wrap m-t-lg" chart-axis="echartsOption2" xaxis-title="预警时间" style="height:400px;"></div>
            </div>
        </div>
        <div tab heading="预警条件" active="activeFlag[4]" ng-click="changeTab(4)">
			<div class="p-t-md corr-tips">
				1、海外发货日期：2月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;国内发货日期：1月<br>
                2、根据发货日期进行判断：如果客户名称=徐州工程机械集团进出口有限公司、智联物流，发货日期超过2个月的将业务数据自动生成到未开票订单预警功能界面。<br>
                3、如果客户名称&lt;&gt;徐州工程机械集团进出口有限公司、智联物流，超过发货日期1个月的将业务数据自动生成到未开票订单预警功能界面。
			</div>
		</div>
    </div>
</div>
